package net.zdreamer.geracomium.ui.more;

import net.zdreamer.geracomium.adapter.FoodIndentAdapter;
import net.zdreamer.geracomium.entity.FoodIndentInfos;
import net.zdreamer.geracomium.ui.BaseActivity;

import android.view.View;
import android.view.View.OnClickListener;

import com.example.geracomium.R;
import com.handmark.pulltorefresh.library.PullToRefreshListView;
import com.handmark.pulltorefresh.library.PullToRefreshBase.Mode;

public class MealsPlanActivity extends BaseActivity implements OnClickListener{
	private PullToRefreshListView pullToRefreshListView;
	private FoodIndentAdapter mAdapter;

	@Override
	protected int getContentView() {
		return R.layout.activity_mealsplan;
	}

	@Override
	protected void init() {
		pullToRefreshListView = (PullToRefreshListView) findViewById(R.id.mealsplan_list);
	}

	@Override
	protected void initViews() {
		initTitle("膳食计划", R.drawable.selector_title_back, R.drawable.queryhistory, true, true);
		pullToRefreshListView.setMode(Mode.BOTH);
		FoodIndentInfos foodinfo = new FoodIndentInfos();
		mAdapter = new FoodIndentAdapter(this, foodinfo.days,
				R.layout.foodinfo_days);
            pullToRefreshListView.setAdapter(mAdapter);
	}

	@Override
	protected void initListener() {
		findViewById(R.id.back).setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		switch(v.getId()){
		case R.id.back:
			MealsPlanActivity.this.finish();
			break;
		}
	}

}
